#pragma once
#include <math.h>

#define ENABLE_MULTI_THREAD	1


#define PLATFORM_WIN32		1
#define yield_cpu()

#ifdef PLATFORM_WIN32
#include <Windows.h>
#undef yield_cpu
#define yield_cpu() YieldProcessor()
#endif

namespace renderit
{
	typedef char int8;
	typedef unsigned char uint8;
	typedef short int int16;
	typedef unsigned short int uint16;
	typedef int	int32;
	typedef unsigned int uint32;
	typedef long long int64;
	typedef unsigned long long uint64;
	
	template<typename T1, typename T2>
	T1 kmin(const T1& a, const T2& b)
	{
		if (a <= b) {
			return a;
		}
		return b;
	}

	template<typename T1, typename T2>
	T1 kmax(const T1& a, const T2& b)
	{
		if (a >= b) {
			return a;
		}
		return b;
	}

	template<typename T1, typename T2, typename T3>
	T1 kclamp(const T1& a, const T2& min, const T3& max)
	{
		return kmax(kmin(a, max), min);
	}

}